<template>
    <CommonBackground>
        <template slot="form">
            <div class="login-form">
                <div class="login-text">Lock</div>
                <img src="../../asset/images/rabbit.png" class="login-form-img"/>
                <div class="login-form-content">
                    <el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
                        <el-form-item label="用户名" prop="pass">
                            <el-input type="text" v-model="ruleForm.user"
                            prefix-icon="el-icon-s-custom" autocomplete="off"></el-input>
                        </el-form-item>
                        <el-form-item label="密码" prop="checkPass">
                            <el-input type="password" v-model="ruleForm.password"
                            prefix-icon="el-icon-key" autocomplete="off"></el-input>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="text">忘记密码</el-button>
                            <el-button type="text" @click="register('/register')">注册</el-button>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" @click="login">登录</el-button>
                        </el-form-item>
                    </el-form>
                </div>
            </div>
        </template>
    </CommonBackground>
</template>
<script>
import CommonBackground from '@/components/commonBackground'
import routerPush from '@/utils/routerPush'
export default {
  name: 'Login',
  components: {
    CommonBackground
  },
  data () {
    return {
      ruleForm: {
        user: '',
        password: ''
      },
      rules: {
        user: [],
        password: []
      }
    }
  },
  methods: {
      register(path){
          routerPush(path)
      },
      login() {
        routerPush('/')
      }
  }
}
</script>
<style lang="less" scoped>
.login-form{
    width: 700px;
    height: 320px;
    background: rgba(255,255,255,0.01);
    border-radius: 4px;
    box-shadow: 0px 0px 69px @color_black;
    margin-top: 10%;
    margin-right: 10%;
    float: right;
}
.login-text{
    font-size: 50px;
    text-align: center;
    line-height: 100px;
    color: @color_green_1;
}
.login-form-img{
    width: 326px;
    height: 198px;
    display: block;
    margin-left: 24px;
    float: left;
}
.login-form-content{
    float: left;
    width: 326px;
    height: 198px;
    box-sizing: border-box;
}
.el-form{
    padding: @space_10px;
    height: 100%;
    box-sizing: border-box;
    .flex_layout(column,space-between,center);
}
.el-form-item{
    display: flex;
    width: @space_full;
}
/deep/ .el-form-item__content{
    margin-left: 0!important;
    width: 200px;
}
/deep/ .el-form-item__label{
    color: @color_green_1;
    width: 54px!important;
    text-align: right;
}
/deep/ .el-form-item:nth-child(3)>.el-form-item__content{
    line-height: normal!important;
    .flex_layout(row,flex-start,center);
    width: @space_full;
}
/deep/ .el-form-item:nth-child(3) .el-button{
    padding: 0;
    margin:0;
    border: none;
    color: @color_blue_2;
    margin-left: 14%;
}
/deep/ .el-form-item:nth-child(3) .el-button:hover{
    text-decoration: underline;
}
/deep/ .el-form-item:nth-child(3) .el-button:active{
    color: @color_blue_1;
}
/deep/ .el-form-item:nth-child(4)>.el-form-item__content{
    width: @space_full;
}
/deep/ .el-form-item:nth-child(4) .el-button{
    margin: 0 15%;
    width: 70%;
}
</style>
